package com.mpq.service.lmpl;


import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.mpq.entity.User;
import com.mpq.interfaces.DataSource;
import com.mpq.mapper.UserMapper;
import com.mpq.aspects.DataSourceNames;
import com.mpq.service.IUserService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lqh
 * @since 2018-12-03
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Override
    @DataSource(name = DataSourceNames.FIRST)
    public User findUserByFirstDb(Long id) {
        return this.selectById(id);
    }

    @Override
    @DataSource(name = DataSourceNames.SECOND)
    public User findUserBySecondDb(Long id) {
        return this.selectById(id);
    }

    @Override
    @DataSource(name = DataSourceNames.THIRD)
    public User findUserByThirdDb(Long id) {
        return this.selectById(id);
    }
}
